#include <iostream>
using namespace std;


int main()
{
    //三目运算符
    //创建三个变量a,b,c
    //将a和b比较，将您变量大赋值给变量c
    int a = 10;
    int b = 20;
    int c = 0;
    c = (a > b ? a : b);
    cout<<"c="<<c<<endl;//20

    (a > b ? a: b) = 100;
    cout<<"a="<<a<<endl;
    cout<<"b="<<b<<endl;
    system("pause");
//c++中三目运算符返回的变量，可以继续赋值
    return 0;
}